package com.jie.scanbarcode.demo

import android.app.Activity
import android.os.Build
import android.view.View
import android.view.WindowManager

/**
 * Activity拓展类
 */
fun Activity.fullScreen(){
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        // 适配刘海屏
        window.attributes.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
    }
    window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            or View.SYSTEM_UI_FLAG_FULLSCREEN)
}